<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="core" %>
<%@ taglib prefix="fmt" uri="fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<title>讨论板</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!-- Loading Bootstrap1 -->
        <link href="../page/front/disc/css/font-awesome.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="../page/front/disc/css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="../page/front/disc/css/icons.css" />
		<link rel="stylesheet" type="text/css" href="../page/front/disc/css/style1.css" />
    	<link rel="stylesheet" type="text/css" href="../page/front/disc/css/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="../page/front/disc/css/style2.css" />
		
		<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="../page/front/disc/js/html5shiv.js"></script>
	      <script src="../page/front/disc/js/respond.min.js"></script>
	    <![endif]-->
		 <style type="text/css">
            .top{
                height:300px;
                width: 60%;
                margin:0 auto ;
                
            }
            #touxiang{
                height:200px;
                width: 200px;
                margin:20px auto;
               
            }
            .top-formation{
                height:20%;
                width: 30%;
                margin :0 auto;
                text-align: center;
                font-size: 16px;
                color: #333; 
            }
            #edit{
            	width:600px;
            	height:50px;
            	margin:0 auto;
            	color:#fff;
            	font-size:16px;
            }
            #edit input{
            	width:400px;
            	height:30px;
            	margin-top:16px;
            	font-size:14px;
            	padding-left:5px;
            	color:#000;
            }
            #edit button{
            	margin-left:20px;
            }
             #img{
            	-webkit-border-radius:200px;
              	-moz-border-radius:200px;
              	border-radius:200px;
            }
        </style>
	</head>
<body> 
		 <div class="top">
	        <div class="top-touxiang" id="touxiang">
				<c:if test="${user.image.imLoclhost!=null}">
				<img id="img" height="200" alt="" width="200" src="../page/upload/images/${user.image.imLoclhost}"/>
				</c:if>
				<c:if test="${user.image.imLoclhost==null}">
				<img id="img" height="200" alt="" width="200" src="../page/upload/images/123456.jpg"/>
				</c:if>
	        </div>
	        <div class="top-formation">
	            ${user.uName}<br>
	            ${user.uBirthday}
	        </div>
	    </div>
	    <div id="edit">
	           主题名称&nbsp;&nbsp;&nbsp;<input type="text" name="name" placeholder="写下你喜欢的主题..." id="nameth"/>
	           <button class="btn btn-primary" id="add"> 创建 </button><br/>
	    </div>
		<nav id="bt-menu" class="bt-menu">
			<a href="#" class="bt-menu-trigger">Menu</a>
			<ul>
				<li><a href="../them/index.html" >搜索</a></li>
				<li><a href="../them/zhuti.html" >我的主题区</a></li>
				<li><a href="../them/new.html" >创建主题区</a></li>
				<li><a href="../index/index.html" >返回首页</a></li>
			</ul>
		</nav>
		
	
	<script src="../page/front/disc/js/classie.js"></script>
	<script src="../page/front/disc/js/borderMenu.js"></script>
	<script src="../page/front/disc/js/jquery-1.8.3.min.js"></script>
   	<script src="../page/front/disc/js/bootstrap.min.js"></script>
   	<script>
		var _gaq = _gaq || []; 	_gaq.push(['_setAccount', 'UA-7489188-1']); _gaq.push(['_trackPageview']);
		(function() {
			var ga = document.createElement('script'); ga.async = true; ga.src = '../page/front/disc/js/ga.js';
			var s = document.getElementsByTagName('script')[0];
			s.parentNode.insertBefore(ga, s);
		})();
	</script>
	
      <script type="text/javascript">
			//表单提交采用json提交
			$("button#add").click(function(){
		          var obj={
						"thName":$("#nameth").val()
					};
		          $.post("../them/name.json?name="+$("#nameth").val(),function(da){
		        	  if(da==0){
						$.post("../them/add.json",obj,function(json){
							if(json != 0){
						        alert("创建成功！");
						        location.href='themone.html?id='+json;
							}else{
						        alert("创建失败！");
							}
						});
		        	  }else{
		        		  alert("该主题讨论区已经存在，您可以在搜索中查看！");
		        	  }
		          });
			});
			//表单提交结束
		</script>
	</body>
</html>  